package com.javastudy.autowiredStudy.asyncStudy;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author mac
 * @date 2021/9/8 9:33 上午
 */
public class MyThreadPool {
    private static ExecutorService executorService = new ThreadPoolExecutor(1,5,60,TimeUnit.SECONDS,new ArrayBlockingQueue<>(200));
    static class Work implements Runnable{

        @Override
        public void run() {
            System.out.println("runable impl");
        }
    }

    public static void main(String[] args) {
        //提交线程执行的结果
        executorService.submit(Work::new);
        //将线程还到线程池当中
        executorService.shutdown();
    }
}
